package cn.iocoder.yudao.module.team.dal.mysql.linetrip;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.team.dal.dataobject.linetrip.LineTripDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.team.controller.admin.linetrip.vo.*;

/**
 * 线路模板—行程 Mapper
 *
 * @author 芋道源码
 */
@Mapper
public interface LineTripMapper extends BaseMapperX<LineTripDO> {

    default PageResult<LineTripDO> selectPage(LineTripPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<LineTripDO>()
                .eqIfPresent(LineTripDO::getType, reqVO.getType())
                .eqIfPresent(LineTripDO::getDates, reqVO.getDates())
                .eqIfPresent(LineTripDO::getStay, reqVO.getStay())
                .eqIfPresent(LineTripDO::getMorning, reqVO.getMorning())
                .eqIfPresent(LineTripDO::getNoon, reqVO.getNoon())
                .eqIfPresent(LineTripDO::getEvening, reqVO.getEvening())
                .eqIfPresent(LineTripDO::getView, reqVO.getView())
                .eqIfPresent(LineTripDO::getColumn1, reqVO.getColumn1())
                .eqIfPresent(LineTripDO::getColumn2, reqVO.getColumn2())
                .eqIfPresent(LineTripDO::getColumn3, reqVO.getColumn3())
                .eqIfPresent(LineTripDO::getColumn4, reqVO.getColumn4())
                .eqIfPresent(LineTripDO::getColumn5, reqVO.getColumn5())
                .betweenIfPresent(LineTripDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(LineTripDO::getId));
    }

}